perm filename ERRATA.TEX[CLS,LSP] blob sn#836429 filedate 1987-03-13 generic text, type T, neo UTF8
\input macros.tex
%\drafttrue
\tolerance=2500
\def\bookline{\CLOS\  Specification}
\def\chapline{Corrections and Amendments to the Document}
\def\CLtL{{\it Common Lisp: The Language}}
\def\pagenumber{\the\pageno}
\def\DocNotes#1#2
{\pageno=1\relax
\def\chapline{#2}\setbox\comline\null
\HeadI{#1}
\leftskip\normalleftskip
\normaltype
}
\footline={\normaltype
\ifodd\pageno\hss\chapline\ \ \folio\else\folio\ \ \bookline\hss\fi}

\def\pglabel
#1{\noindent\hbox to 0pc{\bf\hskip-4pc#1\hss}%
\ignorespaces}

%% Define an italic font for subsection titles.  Cannot use \it in
%% a subsection title because \it cannot be true when \bf is true.

%\font\prbifourteen = ambxsl10 scaled 1200
%\def\hit{\prbifourteen}


\DocNotes{Common Lisp Object System Specification\break Corrections and Amendments to the Document}{Corrections and Amendments to the Document}

\beginSection{Introduction}

This document lists corrections and amendments to the text of the {\it
Common Lisp Object System Specification}.  Corrections are listed by
page number.

\beginSection{Corrections}

\pglabel{p. 1-4} Seventh paragraph. The distinguished class {\bf t} is
mentioned but its characteristics are not described.  Add the
following sentences: ``The class {\bf t} has no superclasses.  It is
a superclass of every class except itself.''

\pglabel{p. 1-5} First paragraph under ``Slots.''  Replace the first
sentence with ``An object has zero or more named slots.  The slots of
an object are determined by the class of the object.  Each slot can
hold one value."

\pglabel{p. 1-6} First paragraph.  Change ``{\bf :instance}" to ``{\bf
:instance} or {\bf :dynamic}.''

\pglabel{p. 1-6} Last paragraph, second sentence.  Change
``lexically available" to ``lexically available as if they were
variables."

\pglabel{p. 1-10} Replace the last sentence with  ``There is also a method
for {\bf setf} of {\tt C2-S3} that writes the value of {\tt S3}."

\pglabel{p. 1-11} Second paragraph.  The term ``access" is used
without definition.  Insert the following after the second sentence:
``In this context, an instance is said to be {\bit accessed\/} when a
generic function is called with the instance as an argument that is
used for method selection or when {\bf slot-value} is called with the
instance as its first argument."

\pglabel{p. 1-11} Third paragraph.  Replace the first sentence with
``If a class is redefined in such a way that the set of local slots
accessible in an instance of the class is changed or the order of
slots in storage is changed, the function {\bf change-class} is called
whenever an instance of the class is updated.''

\pglabel{p. 1-11} Fourth paragraph.  Replace the entire paragraph
with the following: ``Because the class $C\sub o$ does not have a
name, any method for {\bf class-changed} that is specialized to a
particular $C\sub o$ must be written using the functional interface,
that is, by using {\bf add-method} rather than by using {\bf
defmethod}.  See the section ``Introduction to Methods.''\thinspace''

\pglabel{p. 1-11} Fifth paragraph.  In the third sentence change ``Each
slot of the new version" to ``Each local slot of the new version."  In
the last sentence delete ``For local slots."

\pglabel{p. 1-11} Last paragraph.  Change ``the value of that slot will
be the same in both instances" to ``the value of that slot is
unchanged."

\pglabel{p. 1-12} Last paragraph.  Change ``Whether {\bf defclass} is
allowed to change the metaclass" to ``Whether {\bf defclass} is allowed
to change the metaclass and whether redefining a class causes
existing instances to be updated."

\pglabel{p. 1-13} First paragraph.  Delete the last sentence.  

\pglabel{p. 1-13} Add the following as a new paragraph at the end of
the page: ``Every class that has a name has a corresponding type with
the same name.  In addition, every class object is a valid type
specifier.  Thus the expression {\tt (typep {\it object class\/})}
evaluates to true if the class of {\it object\/} is {\it class\/}
itself or a subclass of {\it class}.  The evaluation of the expression
{\tt (subtypep {\it class1 class2\/})} returns the values {\bf t t} if
{\it class1\/} is a subclass of {\it class2\/} or if they are the same
class; otherwise it returns the values {\bf nil t}."

\pglabel{p. 1-18} First paragraph under ``Introduction to setf Generic
Functions."  Change ``{\tt (setf ({\it generic-function-name
arguments\/}) {\it new-value\/})}" to ``{\tt (setf ({\it symbol
arguments\/}) {\it new-value\/})}."

\pglabel{p. 1-18} Last paragraph.  The use of the term ``parameter
specifier" is inconsistent with its use in \CLtL.  Replace the entire
paragraph with the following: ``Each method has a {\bit specialized
lambda-list}, which determines when that method can be selected.  A
specialized lambda-list is like an ordinary lambda-list except that a
{\bit specialized parameter\/} may occur instead of the name of a
parameter.  A specialized parameter is a list, {\tt ({\it
variable-name parameter-specializer-name\/})}, where {\it
parameter-specializer-name\/} is a parameter specializer name.  Every
parameter specializer name is a Common Lisp type specifier, but the
only Common Lisp type specifiers that are valid as parameter
specializer names are the following:\/''

\pglabel{p. 1-19}  Delete the first line since the two
bulleted items are now introduced by the preceding paragraph.

\pglabel{p. 1-19} Fourth paragraph, beginning ``Only required
parameters can be specialized."  Replace the paragraph with the
following: ``Only required parameters can be specialized, and there
must be a parameter specializer for each required parameter.  For
notational simplicity, if some required parameter in a specialized
lambda-list is simply a variable name, its parameter specializer
defaults to the class named {\bf t}.''

\pglabel{p. 1-19} Fifth paragraph.  Change ``when the class of each
required argument" to ``when each required argument."

\pglabel{p. 1-19} Seventh paragraph.  Replace this paragraph with
``This proposal requires that both parameter specializers and
parameter specializer names be Common Lisp type specifiers."

\pglabel{p. 1-19} Tenth paragraph.  Replace the paragraph with 
``A method all of whose parameter
 specializers are the class named {\bf t} is a {\bit default method\/}; it
is always applicable but often shadowed by a more specific method."

\pglabel{p. 1-19} Last paragraph, fourth sentence.  Change ``cons" to ``list."

\pglabel{p. 1-22} Second paragraph. Change ``the specializers must be
quoted objects" to ``the specializers must be equal.''

\pglabel{p. 1-23} Second sentence.  Change ``{\bf defmacro}" to ``{\bf
defmethod}."

\pglabel{p. 1-25} Sixth paragraph.  Change ``All {\bf :around} methods run
before any primary methods run." to ``All {\bf :around} methods run
before any other methods run."

\pglabel{p. 1-26} First paragraph.  Change ``Flavors, Smalltalk-80, and
Loops" to ``Smalltalk-80, Loops, and CommonObjects."

\pglabel{p. 2-8} Purpose paragraph.  Add the following as a second
paragraph: ``The generic function {\bf change-class} is invoked
automatically by the system after {\bf defclass} has been used to
redefine an existing class.  It can also be explicitly invoked by the
user."

\pglabel{p. 2-11} Purpose paragraph.  Delete the sentences ``The
generic function {\bf change-class} is invoked automatically by the
system after {\bf defclass} has been used to redefine an existing
class.  It can also be explicitly invoked by the user."  Add the
sentence ``The function {\bf class-changed} is called only by the
function {\bf change-class}."

\pglabel{p. 2-11} Second Arguments paragraph.  Delete the second sentence.

\pglabel{p. 2-11} First Remarks paragraph.  Delete this.

\pglabel{p. 2-11} Second Remarks paragraph.  Replace this paragraph
with ``The arguments to {\bf class-changed} are computed by {\bf
change-class}.  The first argument is an instance of the original
class created to hold the old slot values temporarily.  This argument
has dynamic extent within {\bf class-changed}, and therefore it is an
error to reference it in any way once {\bf class-changed} returns.''

\pglabel{p. 2-15} Third paragraph.  Add ``A class object can be used
as a type specifier.  Thus {\tt (typep {\it object class\/})} is true
if the class of the {\it object\/} is {\it class\/} itself or a
subclass of {\it class}."

\pglabel{p. 2-15} Last line.  Delete this.  The macro {\bf defclass}
has no effect on the value cells of symbols.

\pglabel{p. 2-17} Third bullet ({\bf :allocation}).  Change ``in the
class instance" to ``in each instance."

\pglabel{p. 2-18} First bullet ({\bf :type}).  There is no discussion
of the meaning and enforcement of {\bf :type}.  Add the following
sentences: ``This specifies that the contents of the slot will always
be of the specified data type.  It effectively declares the result
type of the reader generic function when applied to an object of this
class.  An implementation may or may not choose to check the type of
the new value when initializing or assigning to a slot.''

\pglabel{p. 2-18} Third bullet ({\bf :accessor-prefix}).  Change
``These accessor functions are interned'' to ``The names of these accessor
functions are interned.''

\pglabel{p. 2-18} Fourth bullet ({\bf :reader-prefix}).  Change
``There reader functions are interned'' to ``The names of these reader
functions are interned.''

\pglabel{p. 2-26} Syntax, {\it short-form-option}. Delete the {\tt :order}
clause.

\pglabel{p. 2-27} Fourth bullet.  Delete this item.

\pglabel{p. 2-29} First paragraph.  Replace the next to last sentence
with the following: ``If {\bf :description} is not specified, a
default description is generated based on the variable name and the
qualifier patterns and on whether this method-group includes the
unqualified methods."

\pglabel{p. 2-33} Third paragraph.  Change ``If no generic function is
currently named by the symbol {\it name\/}" to ``If {\tt (fboundp {\it
name\/})} is {\bf nil}."

\pglabel{p. 2-34} First paragraph.  Change ``primary (in this case,
unqualified) methods" to ``unqualified methods."

\pglabel{p. 2-34} Second paragraph.  Replace the first two sentences
of the paragraph with the following: ``The {\it
specialized-lambda-list\/} argument is like an ordinary function
lambda-list except that the names of required parameters can be
replaced by specialized parameters.  A specialized parameter is a list
of the form {\tt ({\it variable-name
parameter-specializer-name\/})}.''

\pglabel{p. 2-35} Syntax, {\it specialized-setf-lambda-list}.  Change
``{\it specializer\/}" to ``{\it parameter-specializer-name}."

\pglabel{p. 2-39} Last Arguments paragraph.  Change ``{\it second\/}" to
``{\it errorp}."

\pglabel{p. 2-41} Second Purpose paragraph.  Replace it with ``Whether
{\bf invalid-method-error} returns to its caller or exits
via {\bf throw} is implementation dependent."

\pglabel{p. 2-46} Second Purpose paragraph, first sentence.  Change ``a
form whose first element" to ``a form whose effect is the same as a
form whose first element."

\pglabel{p. 2-47} Values paragraph.  Change ``a form whose first
element" to ``a form whose effect is the same as a form whose first
element."

\pglabel{p. 2-48} Second Purpose paragraph.  Replace it with ``Whether
{\bf method-combination-error} returns to its caller or exits
via {\bf throw} is implementation dependent."

\pglabel{p. 2-53} Syntax.  Remove ``{\tt &optional} {\it errorp}." 

\pglabel{p. 2-53} Last Arguments paragraph.  Replace this paragraph with
``The function {\bf remove-method} does not signal an error if no such method
is part of the generic function." 

\pglabel{p. 2-55} Last paragraph, first sentence.  Delete ``or a superclass."

\pglabel{p. 2-55} Last paragraph, fourth sentence.  Change ``not a
subclass of the specified class" to ``not the specified class or a
subclass of the specified class."

\pglabel{p. 2-55} Last paragraph, fifth sentence.  Change ``superclass of
the instance" to ``superclass of the actual class of the instance" and
change ``different" to ``smaller."

\pglabel{p. 2-56} Second paragraph.  Change ``using the accessor function"
to ``calling the accessor function," ``is used to access" to ``is called
to access," and ``accesses the slots by using" to ``accesses the slots
by calling."

\pglabel{p. 2-56} Values paragraph.  Change ``value" to ``values" to clarify
that the body can return multiple values.

\endSection%{Corrections}

\beginSection{Amendments}

\pglabel{p. 1-5}  At the end of ``Defining Classes,'' add ``A class
definition cannot contain two slot specifiers with the same name."
[This is explained under {\bf defclass}, p. 2-17.]


\pglabel{p. 1-6} Replace the second and third paragraphs with the following: 

``We say that a class {\bit defines\/} a slot with a given name when
the {\bf defclass} form for that class contains a slot specifier with
that name.  Defining a local slot does not immediately create a slot;
it causes a slot to be created each time an instance of the class is
created.  Defining a shared slot creates a slot.

``We say that a slot is {\bit accessible\/} in an instance of a class if
the slot is defined by the class of the instance or is inherited from
a superclass of that class.  At most one slot of a given name can be
accessible in an instance.  A detailed explanation of the inheritance
of slots is given in the section ``Inheritance of Slots and Slot
Options.''\thinspace''

\pglabel{p. 1-11} Last paragraph.  Break the paragraph after the third
sentence so that local slots and shared slots are discussed in
separate paragraphs.  Clarify that the paragraph discussing shared
slots refers to what happens at the time the class is redefined, and
shared slots are not affected by updating an instance nor by the
values of local slots.

\pglabel{p. 2-5} Values paragraph.  Replace the sentence with
``The value is {\it generic-function}." 

\pglabel{p. 2-8} Values paragraph.   Replace the sentence with
``The value is {\it instance}." 

\pglabel{p. 2-17} Second paragraph.  Delete ``, from their
superclasses, and so on."

\pglabel{p. 2-38} Fourth Arguments paragraph.  Change ``If the first
argument is a symbol" to ``If the first argument is a symbol that names
a class."

\pglabel{p. 2-38}  Last Arguments paragraph.  Change ``If the first argument
is a symbol" to ``If the first argument is a symbol that has a setf
generic function associated with it."

\pglabel{p. 2-53} Values paragraph.  Replace the sentence with
``The value is {\it generic-function}." 

\pglabel{p. 2-54} Add pages for {\bf subtypep}, {\bf type-of}, and
{\bf typep}, explaining that {\bf subtypep} and {\bf typep} are to be
extended to accept class objects as type specifiers and explaining
that {\bf type-of} never returns a class object.  What does {\bf
type-of} return when applied to an instance of an anonymous class?

\endSection%{Amendments}

\beginSection{}

The following is a preliminary draft for a revised ``Inheritance of
Slots and Slot Options'' section:

The set of the names of all slots accessible in an instance of a class
$C$ is the union of the sets of names of slots defined by $C$ and its
superclasses.  At most one slot of a given name can be accessible in an
instance.

In the simplest case, only one class among $C$ and its superclasses
defines a slot with a given slot name.  If the class that defines the
slot is not $C$, we say that the slot is {\bit inherited}.  The
characteristics of the slot are determined by the slot specifier of
the defining class.  If the {\bf :allocation} slot option is omitted,
{\bf :instance}, or {\bf :dynamic}, then it specifies a local slot and each
instance of $C$ has its own slot that stores its own value.  If the
{\bf :allocation} slot option is {\bf :class}, then it specifies a shared slot,
the class that defined the slot stores the value, and all instances of
$C$ access that single slot.

In general, more than one class among $C$ and its superclasses can define
a slot with a given name.  In such cases, only one slot with the given
name is accessible in an instance of $C$, and the characteristics of that
slot are a combination of the several slot specifiers, computed as
follows.

\beginlist

\item{\bull}
All the slot specifiers for a given slot name are ordered
from most specific to least specific according to the order in
the class precedence list of $C$ of the classes that define them.

\item{\bull}
The allocation of a slot is controlled by the most specific slot
specifier.  If the most specific slot specifier does not contain
an {\bf :allocation} slot option, {\bf :instance} is used.  Less specific slot
specifiers never affect the allocation.

\item{\bull}
The initform of a slot is controlled by the most specific slot
specifier that contains an {\bf :initform} slot option.  If no slot specifier
contains an {\bf :initform}, the slot has no default initial value form.

\item{\bull} 
The contents of the slot will always be of type {\tt (and
$T\sub 1 \ldots T\sub n$)}, where $T\sub 1 \ldots T\sub n$
are the {\bf :type} slot options contained in all of the slot specifiers.
If no slot specifier contains {\bf :type}, the type is {\bf t}.
\endlist

The {\bf :reader} and {\bf :accessor} slot options were not mentioned because
they create methods, rather than defining characteristics of a slot.
Reader and accessor methods are inherited in the sense described in the
section ``Inheritance of Methods.''

A consequence of the allocation rule is that shared slots can be
shadowed.  If a class $C \sub1$ defines a shared slot named $S$, normally
that single slot is accessible in instances of $C \sub 1$ and all of its
subclasses.  However, if $C \sub 2$ is a subclass of $C \sub 1$ and also
defines a slot named $S$, the slot in $C \sub 1$ is not shared by instances of
$C \sub 2$ and its subclasses.  See the section ``Examples of
Inheritance.''

A consequence of the type rule is that the value of a slot will satisfy the
type constraint of each slot specifier that contributes to that slot.
Note that an implementation may or may not choose to check the type of
the new value when initializing or assigning to a slot.

Methods that access slots know only the name of the slot and the type of
the slot's value.  Suppose a superclass provides a method that expects
to access a shared slot of a given name and a subclass defines a local
slot with the same name.  If the method provided by the superclass is
used on an instance of the subclass, the method accesses the local slot.

\endSection
\endChapter
\bye